<!--This file is the Logic part (Database part) for updating user's password.-->
<?php

include 'DBLibrary/config.php';
include 'DBLibrary/openDB.php';
mysql_select_db($dbname);

$query = mysql_query("SELECT * FROM `rotaract`.`officer` WHERE username = '$username'");
$row = mysql_fetch_array($query);

if (isset($_POST['submit'])) {
    $newpassword = $_POST['password'];
    $newpassword2 = $_POST['password2'];

    $confirm = mysql_query("UPDATE `rotaract`.`officer` SET password = '$newpassword' WHERE username = '$username'");
        
} 
include 'DBLibrary/closeDB.php';
?>